#!/bin/sh

# This can be changed whenever it is decided to use a new
# autotools
#
# Official release tarballs should only be prepared using the
# autotools version agreed on the Ganglia mailing list
#
SUPPORTED="Debian 6.0 (squeeze) amd64"

echo "Bootstrapping libmetrics"
echo "WARNING:"
echo "WARNING: you should only do this on $SUPPORTED"
echo "WARNING: as any other versions of autotools may produce"
echo "WARNING: errors or silently do something unexpected"
echo "WARNING:"
cd libmetrics && ./bootstrap || exit 1
cd ..

echo "Create distribution timestamp"
touch Makefile.am
echo "Running aclocal" &&
aclocal -I m4 &&
echo "Running autoheader" &&
autoheader &&
echo "Creating build" &&
mkdir -p build &&
echo "Running automake" &&
automake --add-missing --copy --foreign 2>/dev/null
echo "Running libtoolize" &&
libtoolize --automake --copy && automake --add-missing --copy --foreign &&
echo "Running autoconf" &&
autoconf -f || exit 1

echo &&
echo "To begin installation, run \"./configure\" now"
